package model

import (
	"context"
	"service/ctrl"
	"service/model/mod"

	gpb "gitee.com/cloudapex/protos/crm_order/pb"
	"google.golang.org/grpc"
)

var UserClass userClass

type userClass struct {
	cli gpb.UserClassSerClient
}

func init() {
	ctrl.GCon.RegistClienter(mod.GCONN_CRM_ORDER, func(c *grpc.ClientConn) {
		UserClass.cli = gpb.NewUserClassSerClient(c)
	})
}

func (this *userClass) AddUserClass(ctx context.Context, in *gpb.UserClassReq) (*gpb.UserClassRes, error) {
	return this.cli.AddUserClass(ctx, in)
}

func (this *userClass) GetUserClass(ctx context.Context, in *gpb.UserClassReq) (*gpb.UserClassRes, error) {
	return this.cli.GetUserClass(ctx, in)
}

func (this *userClass) EditUserClass(ctx context.Context, in *gpb.UserClassReq) (*gpb.UserClassRes, error) {
	return this.cli.EditUserClass(ctx, in)
}

func (this *userClass) GetClassGetAgree(ctx context.Context, in *gpb.ClassAgreeReq) (*gpb.ClassAgreeRes, error) {
	return this.cli.GetClassGetAgree(ctx, in)
}
func (this *userClass) AgreeOrderCreate(ctx context.Context, in *gpb.AgreeOrderCreateReq) (*gpb.AgreeOrderCreateRes, error) {
	return this.cli.AgreeOrderCreate(ctx, in)
}

//	根据用户信息查找用户所有的有效的班型列表
func (this *userClass) GetUserClassList(ctx context.Context, in *gpb.UserClassListReq) (*gpb.UserClassListRes, error) {
	return this.cli.GetUserClassList(ctx, in)
}
